using System;
using UnityEngine;
using UnityEngine.UI;

namespace CGF
{
    //该脚本自动生成或覆盖，不可编辑
    public partial class PopupSucWithdraw
    {   
		public Image Bg;
		public Image Dialog;
		public CButton BtnClose;

        public Reference reference { get; private set; }
        public Action onProsBindCompleted;
        public bool isProsBindCompleted;
        
        public void BindProperties(Transform transform)
        {   
            reference = transform.GetComponent<Reference>();
            if(!reference)return;
            int nodeIndex = 0;
			Bg = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Image>();
			Dialog = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<Image>();
			BtnClose = (reference.nodes[nodeIndex++].obj as GameObject).GetComponent<CButton>();
            isProsBindCompleted = true;
            onProsBindCompleted?.Invoke();
        }
        
        public void SetProsBindCompletedAction(Action action)
        {
            if (isProsBindCompleted)
            {
                action?.Invoke();
            }
            else
            {
                onProsBindCompleted = action;
            }
        }
    }
}
